import sqlite3
import Windows_evtx

def Windows_IDS(conn, file_name, file_size):

    f = open("Windows_log/" + file_name, "wb")
    conn.send("准备好接收".encode("utf-8"))  # 确认接收

    received_size = 0

    while received_size < file_size:
        if file_size - received_size > 1024:
            size = 1024
        else:
            size = file_size - received_size  # 最后一次接收

        data = conn.recv(size)  # 多次接收
        data_len = len(data)
        received_size += data_len
        f.write(data)
    f.close()
    conn.send("4".encode("utf-8"))  # 确认接收4
    Windows_evtx.Log_Get("Windows_log/" + file_name)


